namespace LBCMS.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.B_Code",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        codeName = c.String(maxLength: 50),
                        codeLevel = c.Int(nullable: false),
                        remark1 = c.String(maxLength: 50),
                        remark2 = c.String(maxLength: 50),
                        remark3 = c.String(maxLength: 50),
                        remark4 = c.String(maxLength: 50),
                    })
                .PrimaryKey(t => t.id);
            
            CreateTable(
                "dbo.B_CodeValue",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        itemText = c.String(maxLength: 50),
                        itemValue = c.String(maxLength: 50),
                        sortNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.id);
            
            CreateTable(
                "dbo.B_Config",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        configName = c.String(maxLength: 50),
                        configValue = c.String(maxLength: 150),
                        remark = c.String(maxLength: 250),
                        sortNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.id);
            
            CreateTable(
                "dbo.B_Module",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        title = c.String(),
                        icon = c.String(),
                        href = c.String(),
                        spread = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.id);
            
            CreateTable(
                "dbo.B_Role",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        roleName = c.String(maxLength: 20),
                        roleGuid = c.String(maxLength: 36),
                        sortNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.id);
            
            CreateTable(
                "dbo.B_Users",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        loginID = c.String(maxLength: 50),
                        password = c.String(maxLength: 50),
                        userName = c.String(maxLength: 50),
                        deptCode = c.String(maxLength: 50),
                        email = c.String(maxLength: 50),
                        sex = c.Short(nullable: false),
                        userStatus = c.Boolean(nullable: false),
                        delFlag = c.Boolean(nullable: false),
                        userGuid = c.String(maxLength: 50),
                        lastLoginTime = c.DateTime(nullable: false),
                        addTime = c.DateTime(nullable: false),
                        birthDay = c.DateTime(nullable: false),
                        tel = c.String(),
                    })
                .PrimaryKey(t => t.id);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.B_Users");
            DropTable("dbo.B_Role");
            DropTable("dbo.B_Module");
            DropTable("dbo.B_Config");
            DropTable("dbo.B_CodeValue");
            DropTable("dbo.B_Code");
        }
    }
}
